{extend name="template/base" /}
{block name='style'}
<style>
	td{
		font-size:16px;
	}
	img{
		display: block;
	}
	.imglist{
		width:440px;
		height:260px;
	}

	.imglist img{
		width:400px;
		height:250px;
		float:left;
		cursor:pointer;
	}
	.del{
		display:none;
		width:40px;
		height:250px;
		float:left;
		background: #f33;
		text-align:center;
		color:#fff;
		line-height: 250px;
		cursor:pointer;
	}
	.imglist:hover .del{
		display: block;
	}


</style>
{/block}
{block name="nav"}
{/block}
{block name="content"}
<div class="page-container">
	<table class="table table-border  table-bordered">
	    <tr>
	    	<td style="width:150px;">头像：</td>
	   		<td>
	   			{if condition="$userInfo.headimg"}
		   			<img src="/uploads/headimg/{$userInfo.headimg}" width=80 heigth=80 alt="">
	   			{else/}
	   				暂无
	   			{/if}
	   		</td>
	   	</tr>
	   	<tr>
	    	<td style="width:150px;">身高：</td>
	   		<td>{$userInfo.height}cm</td>
	   	</tr>
	   	<tr>
	    	<td style="width:150px;">体重：</td>
	   		<td>{$userInfo.weight}kg</td>
	   	</tr>
	   	{if condition="$userInfo.idcardimg[0] eq '暂无'"}
	   	   	<tr>
	   	    	<td style="width:150px;">身份证图片：</td>
	   	   		<td>
	   	   			{if condition="$userInfo.idcardimg"}
	   		   			暂无
	   	   			{else/}
	   					暂无
	   	   			{/if}
	   	   		</td>
	   	   	</tr>
	   	{else/}
	   	<tr>
	   	 	<td style="width:150px;">身份证图片：</td>
	   	 	<td></td>
	   	</tr>
	   	<tr>
	   	 	<td></td>
   			<td>
   				{volist name='$userInfo.idcardimg' id='vo'}
   					{if condition="$vo eq '暂无'"}
   						暂无
   					{else/}
   						<div class='imglist'>
		   					<img src="/uploads/renzheng/{$vo.url|imghandle='md_'}" alt="">
		   					<div class='del' data-index='{$vo.id}'>删除</div>
   						</div>
   					{/if}
   				{/volist}
   			</td>
   		</tr>
		{/if}
	</table>
</div>

{/block}
{block name='script'}
<script>
	$('.del').click(function(){
		id=$(this).data('index');
		obj=$(this);
		$.post("{:url('delimg')}",{'id':id},function(r){
			if(r==1){
				layer.msg('删除成功');
				setTimeout(function(){
					obj.parent().remove();
				},1000);
			}else{
				layer.msg('删除失败');
			}
		})
	});
</script>
{/block}